package com.smartwebee.android.blespp.hospital.adapter;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.view.View;
import android.view.ViewGroup;

import com.smartwebee.android.blespp.R;
import com.smartwebee.android.blespp.databinding.AdapterScoreDetailBinding;
import com.smartwebee.android.blespp.hospital.HospitalBaseAdapter;

import java.util.List;

/**
 * Created by steward on 2018/8/9.
 */

public class ScoreAdapter extends HospitalBaseAdapter<String> {
    public ScoreAdapter(Context context, List<String> datas) {
        super(context, datas);
    }

    @Override
    protected View initView(int position, View convertView, ViewGroup parent) {
        AdapterScoreDetailBinding binding;
        if (convertView == null) {
            binding = DataBindingUtil.inflate(inflater, R.layout.adapter_score_detail, parent, false);
            convertView = binding.getRoot();
            convertView.setTag(binding);
        } else {
            binding = (AdapterScoreDetailBinding)convertView.getTag();
        }
        binding.tvName.setText(position + 1 + ". " + getItem(position));
        return convertView;
    }
}
